import { Select } from 'antd';
import { useEffect, useState } from 'react';

export default () => {
  const [name, setname] = useState('');

  const [selectvalue, setselectvalue] = useState('1');

  useEffect(() => {
    if (name == '22') {
      setselectvalue('2');
    }

    if (name == '11') {
      selectvalue('1');
    }
  }, [name]);
  return (
    <>
      <Input value={name} onChange={(e) => setname(e.target.value)} />
      <Select>
        <Option value={1}>1</Option>
        <Option value={2}>2</Option>
      </Select>
    </>
  );
};
